"""Defines argument parsers for REST Interface"""

from flask_restplus import reqparse
from werkzeug.datastructures import FileStorage

file_upload = reqparse.RequestParser()
file_upload.add_argument('sourceId', type=str, help='Unique Source ID for domain')
file_upload.add_argument('config',
                         type=FileStorage,
                         location='files',
                         required=True,
                         help='Config File for Source to upload')

sourceId_parser = reqparse.RequestParser()
sourceId_parser.add_argument('sourceId', type=str, help='Unique Source ID for domain')

config_type = reqparse.RequestParser()
config_type.add_argument('sourceId', type=str, help='Unique Source ID for domain')

job_parser = reqparse.RequestParser()
job_parser.add_argument('job_id', type=str, help='Job ID of live scrape; Get /job to list all jobs')

add_job_parser = reqparse.RequestParser()
add_job_parser.add_argument('sourceId', type=str, help='Unique Source ID for domain', location='form')
add_job_parser.add_argument('interval', type=int, help='Interval in minutes in which the scrape is executed',
                            location='form')

interval_parser = reqparse.RequestParser()
interval_parser.add_argument('interval', type=int, help='Interval in minutes in which the scrape is executed',
                             location='form')
